<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<title></title>
		<link rel="stylesheet" href="../../app/js/bootstrap-3.3.7-dist/css/bootstrap.min.css" />
		<link rel="stylesheet" type="text/css" href="../../app/css/footer.css" />
		<link rel="stylesheet" href="../../app/css/lystyle.css" />
		<link rel="stylesheet" type="text/css" href="../../app/css/backstage.css" />

		<style type="text/css">
			/*修改底部字体颜色*/
			
			.foot:nth-child(2) {
				color: #e83023;
			}
			
			#wrap div#content {
				padding-top: 1.2rem;
			}
		</style>
		<script src="../../app/js/flexible.min.js" type="text/javascript" charset="utf-8"></script>
	</head>

	<body>
		<div id="wrap">
			<div id="main">
				<div id="header">
					<a id="headImg" href="javascript:history.go(-1)"><img class="headImg" src="../../app/images/12.png" /></a>
					<p id="headTitle">订单详情</p>
				</div>
				<div id="content">
					<ul class="ly-li12">
						<li>
							<a><span><b>订单时间：</b><span id="merchantName" ></span></span>
							</a>
						</li>
						<li>
							<a><span><b>商家名称：</b><span id="applyforDate" ></span></span>
							</a>
						</li>
						<li>
							<a><span><b>一级分类：</b><span id="theirProvince" ></span></span>
							</a>
						</li>
						<li>
							<a><span><b>二级分类：</b><span id="site"></span></span>
							</a>
						</li>
						<li>
							<a><span><b>商家区域：</b><span id="classifyOne" ></span></span>
							</a>
						</li>
						<li>
							<a><span><b>销售额：</b><span id="auditStatus" ></span></span>
							</a>
						</li>
						<li>
							<a><span><b>我的分润：</b><span id="applyforUser"></span></span>
							</a>
						</li>
					</ul>
				</div>
			</div>
	</body>
	<script src="../../app/js/jquery-2.2.3.min.js"></script>
	<script type="text/javascript" src="../../app/js/bootstrap-3.3.7-dist/js/bootstrap.min.js"></script>
	<script src="../../app/js/jquery.cookie.js"></script>
	<script>
		var tokenReztApp = $.cookie("tokenReztApp");
		console.log(tokenReztApp);
		if(!tokenReztApp) {
			window.location.href = "../../app/view/login/login/login.html";
		}
		$(function() {
			currentyf();
		});

		//用户信息
		var user, role, goodsId;
		//获取当前会员信息
		function currentyf() {
			$.ajax({
				cache: false,
				type: "GET",
				url: "http://47.104.13.109/member-service/auth/current?token=" + tokenReztApp,
				dataType: "JSON",
				async: false,
				error: function(XMLHttpRequest, textStatus, errorThrown) {
					$.removeCookie('tokenReztApp', {
						expires: 7,
						path: '/'
					});
					$.removeCookie("tokenRh", {
						expires: 7,
						path: '/'
					});
					$.removeCookie('memberId', {
						expires: 7,
						path: '/'
					});
					$.removeCookie('roleId', {
						expires: 7,
						path: '/'
					});
					window.location.href = "../../app/view/login/login/login.html";
				},
				success: function(data) {
					var check = true;
					for(var i = 0; i < data.roleList.length; i++) {
						var roles = data.roleList[i].id;
						var deadline = new Date(data.roleList[i].deadline);
						if(roles == "f2" && deadline >= new Date()) {
							check = false;
							role = roles; //角色
						}
					}
					if(check) {
						alert("权限不足，请升级为创客！");
						window.location.href = "../../app/view/login/login/login.html";
					}
					goodsId = data.id;
					user = data.loginName;
				}
			});
		}
		$(function() {
			sogoAuditId();
		});

		//根据id获取信息
		function sogoAuditId() {
			var orderSn = getUrlParam('orderSn')
			$.ajax({
				type: "GET",
				url: "http://47.104.13.109:80/mall-service/order/get/" + orderSn,
				dataType: "JSON",
				async: false,
				error: function(XMLHttpRequest, textStatus, errorThrown) {
					layer.msg('系统出现异常，请联系系统管理员！');
				},
				success: function(data) {
					$("#merchantName").html(data.orderDate);
					$("#applyforDate").html(data.shopName);
					$("#theirProvince").html(data.classifyOne);
					$("#site").html(data.classifyTwo);
					$("#classifyOne").html(data.shopLocation);
					$("#auditStatus").html(data.orderMoney);
					$("#applyforUser").html(data.agencyShare);
				}
			});
		}

		//根据id查询该区域名
		function regionsId(id) {
			var ss = "";
			$.ajax({
				cache: false,
				type: "GET",
				url: "http://47.104.13.109/user-service/sys/regions/" + id,
				dataType: "JSON",
				async: false,
				error: function(XMLHttpRequest, textStatus, errorThrown) {},
				success: function(data) {
					ss = data.localName;
				}
			});
			return ss;
		}
		//传入url参数名获取值
		function getUrlParam(name) {
			var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)"); //构造一个含有目标参数的正则表达式对象
			var r = window.location.search.substr(1).match(reg); //匹配目标参数
			if(r != null) return unescape(r[2]);
			return null; //返回参数值
		}
	</script>

</html>